package day06Case01;

/**
 * @author Xiao
 * @date 2021/7/6
 */
public class DaffodilNumber {
    /**
     *      需求：
     *          打印水仙花数和水仙花数的个数
     */
    public static void main(String[] args) {
        getDaffodilNum();
    }

    private static void getDaffodilNum() {
        int count = 0;
        for (int i = 100; i < 1000; i++) {
            int g = i % 10;
            int s = i / 10 % 10;
            int b = i / 10 / 10 % 10;
            int num = g * g * g + s * s * s + b * b * b;
            if (num == i) {
                count++;
                System.out.println(num);
            }
        }
        System.out.println("count:" + count);
    }
}
